<?php
$id=$_GET['id'];

 $conn=mysqli_connect('localhost','root','123456');
  mysqli_select_db($conn,'usermessage');
$sql="delete from user where id={$id}";
mysqli_query($conn,$sql);
if (mysqli_affected_rows($conn)==1) {
  echo '<h1>删除成功</h1>';
   header('Refresh:3,Url=../index.php');

}else{
 header('Refresh:3,Url=../reg.php');
    echo '<h1>删除失败</h1>'; 
}